package csm.sql;

/**
 * 
 * @author seungmun
 * @since 2006.1.18.
 * @version
 * @see
 */
public class ParameterSet
{
	private int type;
	private Object value;
	private boolean forOutput;
	private boolean forInOut;
	private boolean forInputOnly;

	public ParameterSet(String connectionName, int type, Object value)
	{
		this(connectionName, type, value, false, false);
		this.forInputOnly = true;
	}

	public ParameterSet(String connectionName, int type, Object value, boolean forOutput)
	{
		this(connectionName, type, value, forOutput, false);
		this.forInputOnly = false;
	}

	public ParameterSet(String connectionName, int type, Object value, boolean forOutput, boolean forInOut)
	{
		DBConfig dbc = DBConfig.getDBConfig(connectionName);
		this.type = dbc.getParameter().getDataType(type);
		this.value = value;
		this.forOutput = forOutput;
		this.forInOut = forInOut;
		this.forInputOnly = false;
	}

	public ParameterSet(int type, Object value)
	{
		this(type, value, false, false);
		this.forInputOnly = true;
	}

	public ParameterSet(int type, Object value, boolean forOutput)
	{
		this(type, value, forOutput, false);
		this.forInputOnly = false;
	}

	public ParameterSet(int type, Object value, boolean forOutput, boolean forInOut)
	{
		this("default", type, value, forOutput, forInOut);
	}

	public int getColumnType()
	{
		return this.type;
	}

	public Object getValue()
	{
		return value;
	}

	public void setValue(Object value)
	{
		this.value = value;
	}

	public boolean isForOuptut()
	{
		return this.forOutput;
	}

	public boolean isForInputOutput()
	{
		return this.forInOut;
	}

	public boolean isForInputOnly()
	{
		return this.forInputOnly;
	}
}
